package com.kotlin.android.simple.provider

import android.app.Activity
import android.content.Context
import android.util.ArrayMap
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.facade.callback.NavigationCallback
import com.kotlin.android.router.RouterManager
import com.kotlin.android.router.path.RouterActivityPath
import com.kotlin.android.router.path.RouterProviderPath
import com.kotlin.android.router.provider.simple.ISimpleProvider

/**
 * 创建者: zl
 * 创建时间: 2020/6/5 10:14 AM
 * 描述:
 */
@Route(path = RouterProviderPath.Provider.PROVIDER_SIMPLE)
class SimpleProvider : ISimpleProvider {
    override fun startSimpleMVVM(map: ArrayMap<String, Any>) {
        RouterManager.navigation(RouterActivityPath.Simple.PAGER_SIMPLE_MVVM, map)
    }

    override fun startSimpleMVVM(
        activity: Activity,
        map: ArrayMap<String, Any>,
        callback: NavigationCallback
    ) {
        RouterManager.navigation(
            RouterActivityPath.Simple.PAGER_SIMPLE_MVVM,
            activity,
            map,
            callback
        )
    }

    override fun startSimpleMVVM2Result(
        activity: Activity,
        map: ArrayMap<String, Any>,
        requestCode: Int
    ) {
        RouterManager.navigation(
            RouterActivityPath.Simple.PAGER_SIMPLE_MVVM2,
            activity,
            map,
            requestCode
        )
    }

    override fun startBatchMVVM() {
        RouterManager.navigation(RouterActivityPath.Simple.PAGER_BATCH_MVVM)
    }

    override fun startPermissionMVVM() {
        RouterManager.navigation(RouterActivityPath.Simple.PAGER_PERMISSION_VM)
    }

    override fun init(context: Context?) {
    }
}